package com.sky.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.math.BigDecimal;

/**
 * 商家实体类
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("merchants") // 指定表名为merchants
public class Merchant {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String username;
    private String password;
    private String name;
    private String businessLicense;
    private String contactNumber;
    private String email;
    private String address;
    private String location;
    private String contact;
    private String bankName;
    private String bankAccount;
    private String status; // pending(待审核), active(活跃), rejected(拒绝), inactive(禁用)
    private String rejectionReason;
    private BigDecimal totalIncome;
    private BigDecimal totalWithdrawals;
    private BigDecimal balance;
    private Integer withdrawalCount;
    private Boolean frozen;
    private String lastLoginTime;
    private String lastWithdrawalTime;
    private String businessStatus; // 营业状态：营业/休息
    private String description; // 商家简介
    private Integer categoryId; // 商家分类ID
    private String avatar; // 商家头像
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}